package consulTest.consul;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by lipor
 * Date 2020/9/7
 */
@RestController
public class ConsulController {

    @Autowired
    private ConsulConfig config;

    @RequestMapping(value = "/getConfig")
    public String getConfig() {
        System.out.println(config.toString());
        return config.toString();
    }

    @RequestMapping(value = "/getTitle")
    public String getTitle() {
        System.out.println(config.getTitle());
        return config.getTitle();
    }

    @GetMapping("/heart/beat")
    public String health() {
        return "health";
    }

}

